package by.siarhei.java.tij.reusing.exercises.ex19;

/**
 * @author Siarhei Shchahratsou <s.siarhei@gmail.com>
 * @since 18.03.14
 */
public class Excercise19 {
    public static void main(String[] args) {
        Holder holder = new Holder();

        //we can't change final reference
        //java: cannot assign a value to final variable object
        //holder.object = holder.mdobj;
    }
}

class Holder {
    final Object object;
    Object mdobj;

    {
        //this block is executed before constructor
        //java: variable object might not have been initialized
        //mdobj = object;
    }

    Holder(Object object) {
        this.object = object;
    }

    Holder() {
        this.object = new Object();
    }
}
